<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    <title>第十五课 事件</title>
    <style>
        #div1{
            width:300px;
            height:300px;
            background: orange;
        }
    </style>
</head> 
<body>
    <div id="div1"></div>
    <script>
        // document.onkeyup = function(event){
        //     var event = event || window.event;
        //     console.log(event);
        //     // if(event.keyCode == 13){
        //     //     console.log('按键是回车键');
        //     // }
        // }
        var div1 = document.getElementById('div1');
        div1.onclick = function(event){
            var event = event || window.event;
            console.log(event.eventPhase);
            // event.target.style.background = 'blue';
        }
        // document.onclick = function(event){
        //     var event = event || window.event;
        //     console.log(event);
        // }        
    </script>
</body> 
</html>